package com.spring.cas.vo;

import java.io.Serializable;

/**
 * @description: 返回对象数据格式类
 * @author: lfc
 * @version: 2020/6/29 10:25
 */
public class ResultVO<T> implements Serializable {

    private String code;
    private String msg;
    private T data;

    public String getCode() {
        return code;
    }

    public ResultVO<T> setCode(String code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public ResultVO<T> setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public T getData() {
        return data;
    }

    public ResultVO<T> setData(T data) {
        this.data = data;
        return this;
    }

    public ResultVO<T> success(T t) {
        ResultVO<T> resultVO = new ResultVO<>();

        resultVO.setCode("200");
        resultVO.setMsg("success");
        resultVO.setData(t);

        return resultVO;
    }
}
